<div class="nav">
    <a href="{:U('index')}">模型列表</a>
    <a href="{:U('attr_index',array('model_id'=>$model_id))}">属性管理</a>
    <a class="sel" href="{:U('attr_add',array('model_id'=>$model_id))}">添加属性</a>
</div>
<div class="add">
  <form method="post" action="" >
  <table class="table_add">
    <tr>
      <td width="100px">属性名称</td>
      <td><input class="input1" type="text" name="attr_name" id="attr_name" value="" style="width:140px" /> </td>
    </tr>
    <tr>
      <td width="100px">输入方式</td>
      <td>
          <select name="attr_type" id="attr_type" class="sel1">
              <option value="1">输入框</option>
              <option value="2">选择框</option>
              <option value="3">单选框</option>
              <option value="4">多选框</option>
          </select>
      </td>
    </tr>
    <tr class="tr_sel" style="display:none;">
      <td width="100px">筛选值</td>
      <td>
          <textarea name="attr_sel_name" id="attr_sel_name" class="textarea1" style="width:500px;height:60px;text-align:left;line-height:20px;"></textarea>
          <span class="msg">多个选项用英文逗号,分隔</span>
      </td>
    </tr>
     <tr class="tr_sel" style="display:none;">
      <td width="100px">前台搜索</td>
      <td>
          <select name="is_search" id="is_search" class="sel1">
              <option value="1">不搜索</option>
              <option value="2">单选搜索</option>
              <option value="3">多选搜索</option>
          </select>
      </td>
    </tr>
    <tr>
      <td width="100px">顺序编号</td>
      <td><input class="input1" type="text" name="order_id" id="order_id" value="1000" style="width:60px" /> <span class="msg">*</span></td>
    </tr>
    <tr>
      <td width="100px">是否启用</td>
      <td><select name="is_enable" id="is_enable" class="sel1">
             <option value="1">启用</option>
             <option value="0">不启用</option>
          </select>
      </td>
    </tr>
    <tr>
      <td></td>
      <td><input type="submit" class="btn1" value="提 交" /> &nbsp; <input class="btn4" type="reset" value="重 置" /> &nbsp; <input class="btn3"  type="button" onclick="window.history.back()" value="返 回" /></td>
    </tr>
  </table>
    <input type="hidden" name="model_id" id="model_id" value="{$model_id}" />
    <script type="text/javascript">
          $(function(){
              $("#attr_type").change(function(){
                  var attr_type = $("#attr_type").val();
                  if(attr_type == '2' || attr_type == '3' || attr_type == '4') {
                      $(".tr_sel").show();
                  } else {
                      $(".tr_sel").hide();
                  }
              })
          });   
    </script>
  </form>
</div>
